package com.felix.book.thinking.in.java;

/**
 * DotThis
 *
 * @author xuejinhua
 * @date 2018/11/13 18:00
 */
public class DotThis {
    void f(){ System.out.println("DotThis.f()"); }
    public class Inner{
        public DotThis outer(){
            // a plain "this" would be Inner's "this"
            return DotThis.this;
        }
        public Inner self(){
            // a plain "this" would be Inner's "this"
            return Inner.this;
        }

        void f(){ System.out.println("Inner.f()"); }
    }
    public Inner inner(){ return new Inner(); }
    public static void main(String[] args){
        DotThis dt = new DotThis();
        DotThis.Inner dti = dt.inner();
        dti.outer().f();
        dti.self().f();
    }
}
